package ABC.Z314;

import java.util.Objects;

public class Staff {
    private String name;
    private String sex;
    private String zhiwu;
    private String gonghao;
    private int age;
    private double salary;

    public Staff() {
    }

    public Staff(String gonghao) {
        this.gonghao = gonghao;
    }

    public Staff(String name, String sex, String zhiwu, String gonghao, int age, double salary) {
        this.name = name;
        this.sex = sex;
        this.zhiwu = zhiwu;
        this.gonghao = gonghao;
        this.age = age;
        this.salary = salary;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public String getZhiwu() {
        return zhiwu;
    }

    public void setZhiwu(String zhiwu) {
        this.zhiwu = zhiwu;
    }

    public String getGonghao() {
        return gonghao;
    }

    public void setGonghao(String gonghao) {
        this.gonghao = gonghao;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Staff staff = (Staff) o;
        return Objects.equals(gonghao, staff.gonghao);
    }

    @Override
    public int hashCode() {
        return Objects.hash(gonghao);
    }

    @Override
    public String toString() {
        return "员工{" +
                "姓名：" + name + "\t" +
                "性别：" + sex +"\t" +
                "职务：" + zhiwu + "\t" +
                "工号：" + gonghao + "\t"+
                "年龄：" + age +"\t"+
                "薪水：" + salary +
                '}';
    }
}
